var xmlHttp;

function createXMLHttpRequest() {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}

function startRequest() {
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleStateChange;
//xmlHttp.open("get", "teste2.php", true);
xmlHttp.open("get", "teste.php?login=" + document.getElementById('login').value, true);
// xmlHttp.send("login=" + document.getElementById("login") + "&endereco=" + document.getElementById("endereco"));
xmlHttp.send(null);
}

function handleStateChange() {
if(xmlHttp.readyState == 4) {
if(xmlHttp.status == 200) {
document.getElementById("resultado").innerHTML = xmlHttp.responseText;
}
}
}